negotiator
Class Bid
java.lang.Object
negotiator.Bid
- All Implemented Interfaces:
- negotiator.XMLable
public final class Bid
- extends java.lang.Object
- implements negotiator.XMLable
Wouter: a bid is a set of pairs, where idnumber is the unique number of the issue,
and value is the picked alternative.
- Author:
- Dmytro Tykhonov & Koen Hindriks
|
Constructor Summary |
Bid()
Create a new empty bid of which the values still must be set. |
Bid(Domain domainP,
java.util.HashMap<java.lang.Integer,Value> bidP)
create a new bid in a domain. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Bid
public Bid()
- Create a new empty bid of which the values still must be set.
Bid
public Bid(Domain domainP,
java.util.HashMap<java.lang.Integer,Value> bidP)
throws java.lang.Exception
- create a new bid in a domain. Partially checks the validity of the bid as well
There is only this constructor because we require that ALL values in the domain
get assigned a value.
- Parameters:
domainP - the domain in which the bid is donebidP - HashMap, which is a set of pairs
- Throws:
java.lang.Exception - if the bid is not a legal bid in the domain.
getValue
public Value getValue(int issueNr)
throws java.lang.Exception
- Parameters:
issueNr - number of an issue.
- Returns:
- the picked value for given issue idnumber
- Throws:
java.lang.Exception - if there exist no issue with the given number.
setValue
public void setValue(int issueId,
Value pValue)
- Set the value of the issue with the given issueID to the given value.
- Parameters:
issueId - unique ID of an issue.pValue - value of the issue.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
equals
public boolean equals(Bid pBid)
- Parameters:
pBid - to which this bid must be compared.
- Returns:
- true if the values of this and the given bid are equal.
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
toXML
public negotiator.xml.SimpleElement toXML()
- Specified by:
toXML in interface negotiator.XMLable
- Returns:
- XML representation of the given object.
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object